package cn.dida.core;

/**
 * 配合RoutingDataSource做数据源的动态切换 datasourceKey：存放当前要使用的数据源的key
 * @author weiwei
 */
public class DatasourceHolder {
    private static final ThreadLocal<String> datasourceKey = new ThreadLocal<String>();

    public static void setDatasourceKey(String key) {
        datasourceKey.set(key);
    }

    public static String getDatasourceKey() {
        return (String) datasourceKey.get();
    }

}
